<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>slot</title>
  </head>
  <body>
    <div id="app">
      <input v-model="color"/>
      <component-with-scoped-slot>
        <template v-slot:header="xxxx">
          <h1 :style="{color,backgroundColor:xxxx.backgroundColor}">hello</h1>
        </template>
      </component-with-scoped-slot>
    </div>
    <script src="https://unpkg.com/vue@2.6.14/dist/vue.js"></script>
    <script>
      var vm = new Vue({
        el: "#app",
        data:()=>({color:'red'}),
        components: {
          "component-with-scoped-slot": {
            data:()=>({backgroundColor:'green'}),
            template: `
            <div
              <slot name="header" :backgroundColor="backgroundColor" a='1' b='2'></slot>
            </div>`,
          },
        },
      });
    </script>
  </body>
</html>
